from django.conf.urls import patterns, include, url
from frontend.views import *
from backend.views import *
from django.contrib import admin
admin.autodiscover()
# Uncomment the next two lines to enable the admin:
# from django.contrib import admin
# admin.autodiscover()

# provide to run css, js,image
import os.path
site_media = os.path.join(
	os.path.dirname(__file__), 'site_media'
)
#


urlpatterns = patterns('',
	(r'^$', main_page),
	(r'^home/$', home_page),
	
	(r'^login/$', 'django.contrib.auth.views.login'),
	(r'^logout/$', logout_page), 
	
	(r'^about/$', about_page),
	(r'^contact/$', contact_page),
	(r'^register/$', register_page),
	(r'^login1/$', 'django.contrib.auth.views.login'),
	(r'^backend/$', backend_page),
	(r'^backend/book/$', book_page),
	(r'^book/$',book_page_frontend),
	(r'^book/page(\d+)/$',book_page_pagging),
	(r'^book/detail/(\d+)/$',book_detail_page),
	(r'^special/$',special_page),
	(r'^special/page(\d+)/$',special_page_pagging),
	(r'^category/(\d+)/$',category_page),
	(r'^services/$',services_page),
	(r'^privacy/$',privacy_page),
	(r'^backend/user/view/$',user_page),
	(r'^backend/user/view/page(\d+)/$',user_page_paging),
	(r'^backend/category/view/$',back_category_page),
	(r'^backend/category/view/page(\d+)/$',back_category_page_paging),
	(r'^backend/book/view/$',back_book_page),
	(r'^backend/book/view/page(\d+)/$',back_book_page_paging),
	(r'^backend/book/view/category/(\d+)/$',view_category_book),
	(r'^backend/category/add/new/$',add_category_page),
	(r'^backend/static/view/$',static_page),
	(r'^backend/static/edit/(\d+)/$',static_edit_page),
	(r'^backend/setting/view/$',setting_page),
	(r'^backend/setting/edit/(\d+)/$',setting_edit_page),
    # Examples:
    # url(r'^$', 'bookstore.views.home', name='home'),
    # url(r'^bookstore/', include('bookstore.foo.urls')),

    # Uncomment the admin/doc line below to enable admin documentation:
    # url(r'^admin/doc/', include('django.contrib.admindocs.urls')),

    # Uncomment the next line to enable the admin:
    url(r'^admin/', include(admin.site.urls)),
	(r'^site_media/(?P<path>.*)$', 'django.views.static.serve',
	{ 'document_root': site_media }),
)
